package com.base.mapper.voipmapper;

import com.base.po.sqlparam.RechargeablecardsExamplePage;
import com.base.po.voip.Rechargeablecards;
import com.base.po.voip.RechargeablecardsExample;
import com.base.po.voip.Users;
import com.base.utils.Page;

import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface RechargeablecardsMapper {
	int countByExample(RechargeablecardsExample example);

	int deleteByExample(RechargeablecardsExample example);

	int deleteByPrimaryKey(String id);

	int insert(Rechargeablecards record);

	int insertCards(List<Rechargeablecards> example);

	int insertSelective(Rechargeablecards record);

	List<Rechargeablecards> selectByExample(RechargeablecardsExample example);

	List<Rechargeablecards> selectByExamplePage(RechargeablecardsExamplePage example);
	
	List<Rechargeablecards> selectByListParentid(List<Users> list_shop);
	
	List<Rechargeablecards> selectByCardNo(@Param("cardno") String cardno);
	
	List<Rechargeablecards> selectByAll(@Param("page") Page page, @Param("status") Integer status,
                                        @Param("batch") String batch, @Param("money") Integer money, @Param("mobile") String mobile,
                                        @Param("parentid") String parentid, @Param("cardno") String cardno, @Param("termofvalidity") Integer termofvalidity,
                                        @Param("probationperiod") Integer probationperiod, @Param("cardnoFrom") String cardnoFrom, @Param("cardnoTo") String cardnoTo,
                                        @Param("datastatus") Boolean datastatus, @Param("type") Integer type, @Param("feelroute") String feelroute);

	List<Rechargeablecards> selectByParentid(@Param("page") Page page, @Param("parentid") String parentid, @Param("status") Integer status,
                                             @Param("batch") String batch, @Param("money") Integer money, @Param("mobile") String mobile,
                                             @Param("id") String id, @Param("cardno") String cardno, @Param("termofvalidity") Integer termofvalidity,
                                             @Param("probationperiod") Integer probationperiod, @Param("cardnoFrom") String cardnoFrom, @Param("cardnoTo") String cardnoTo,
                                             @Param("datastatus") Boolean datastatus, @Param("type") Integer type, @Param("feelroute") String feelroute);
	
	List<Rechargeablecards> selectByShopid(@Param("page") Page page, @Param("shopid") String shopid, @Param("status") Integer status,
                                           @Param("batch") String batch, @Param("money") Integer money, @Param("mobile") String mobile,
                                           @Param("id") String id, @Param("cardno") String cardno, @Param("termofvalidity") Integer termofvalidity,
                                           @Param("probationperiod") Integer probationperiod, @Param("cardnoFrom") String cardnoFrom, @Param("cardnoTo") String cardnoTo,
                                           @Param("datastatus") Boolean datastatus);
	
	List<Rechargeablecards> selectByShopidNotAll(@Param("page") Page page, @Param("shopid") String shopid, @Param("status") Integer status,
                                                 @Param("batch") String batch, @Param("money") Integer money, @Param("mobile") String mobile,
                                                 @Param("id") String id, @Param("cardno") String cardno, @Param("termofvalidity") Integer termofvalidity,
                                                 @Param("probationperiod") Integer probationperiod, @Param("cardnoFrom") String cardnoFrom, @Param("cardnoTo") String cardnoTo,
                                                 @Param("datastatus") Boolean datastatus, @Param("type") Integer type, @Param("feelroute") String feelroute);
	
	Rechargeablecards selectByPrimaryKey(String id);

	String selectMaxCardNo();

	List<Rechargeablecards> selectCard(@Param("parentid") String parentid, @Param("batch") String batch);

	int updateByExampleSelective(@Param("record") Rechargeablecards record,
                                 @Param("example") RechargeablecardsExample example);

	int updateByExample(@Param("record") Rechargeablecards record, @Param("example") RechargeablecardsExample example);

	int updateByPrimaryKeySelective(Rechargeablecards record);

	int updateByPrimaryKey(Rechargeablecards record);
	
	int countByAll(@Param("status") Integer status, @Param("batch") String batch, @Param("money") Integer money,
                   @Param("mobile") String mobile, @Param("parentid") String parentid, @Param("cardno") String cardno, @Param("termofvalidity") Integer termofvalidity,
                   @Param("probationperiod") Integer probationperiod, @Param("cardnoFrom") String cardnoFrom, @Param("cardnoTo") String cardnoTo,
                   @Param("datastatus") Boolean datastatus, @Param("type") Integer type, @Param("feelroute") String feelroute);
	
	int countByParentid(@Param("parentid") String parentid, @Param("status") Integer status, @Param("batch") String batch, @Param("money") Integer money,
                        @Param("mobile") String mobile, @Param("id") String id, @Param("cardno") String cardno, @Param("termofvalidity") Integer termofvalidity,
                        @Param("probationperiod") Integer probationperiod, @Param("cardnoFrom") String cardnoFrom, @Param("cardnoTo") String cardnoTo,
                        @Param("datastatus") Boolean datastatus, @Param("type") Integer type, @Param("feelroute") String feelroute);
	
	int countByShopid(@Param("shopid") String shopid, @Param("status") Integer status, @Param("batch") String batch, @Param("money") Integer money,
                      @Param("mobile") String mobile, @Param("id") String id, @Param("cardno") String cardno, @Param("termofvalidity") Integer termofvalidity,
                      @Param("probationperiod") Integer probationperiod, @Param("cardnoFrom") String cardnoFrom, @Param("cardnoTo") String cardnoTo,
                      @Param("datastatus") Boolean datastatus);
	
	int countByShopidNotAll(@Param("shopid") String shopid, @Param("status") Integer status, @Param("batch") String batch, @Param("money") Integer money,
                            @Param("mobile") String mobile, @Param("id") String id, @Param("cardno") String cardno, @Param("termofvalidity") Integer termofvalidity,
                            @Param("probationperiod") Integer probationperiod, @Param("cardnoFrom") String cardnoFrom, @Param("cardnoTo") String cardnoTo,
                            @Param("datastatus") Boolean datastatus, @Param("type") Integer type, @Param("feelroute") String feelroute);

	int updateByCardNo(@Param("parentId") String parentId, @Param("cardnoFrom") String cardnoFrom, @Param("cardnoTo") String cardnoTo);

    int countByParentidusertime(@Param("parentid") String parentid, @Param("status") Integer status, @Param("batch") String batch, @Param("money") Integer money,
								@Param("mobile") String mobile, @Param("id") String id, @Param("cardno") String cardno, @Param("termofvalidity") Integer termofvalidity,
								@Param("probationperiod") Integer probationperiod, @Param("cardnoFrom") String cardnoFrom, @Param("cardnoTo") String cardnoTo,
								@Param("datastatus") Boolean datastatus, @Param("type") Integer type, @Param("feelroute") String feelroute, @Param("usetime1") Date usetime1, @Param("usetime2") Date usetime2);

	List<Rechargeablecards> selectByParentidusetime(@Param("page") Page page, @Param("parentid") String parentid, @Param("status") Integer status,
													@Param("batch") String batch, @Param("money") Integer money, @Param("mobile") String mobile,
													@Param("id") String id, @Param("cardno") String cardno, @Param("termofvalidity") Integer termofvalidity,
													@Param("probationperiod") Integer probationperiod, @Param("cardnoFrom") String cardnoFrom, @Param("cardnoTo") String cardnoTo,
													@Param("datastatus") Boolean datastatus, @Param("type") Integer type, @Param("feelroute") String feelroute, @Param("usetime1") Date usetime1, @Param("usetime2") Date usetime2);

	List<String> selectCardsCountBymoney(@Param("userid") String userid, @Param("usetime1") String usetime1,@Param("usetime2")  String usetime2);

    List<Rechargeablecards> selectByAllNotOrder(@Param("page") Page page, @Param("status") Integer status,
												@Param("batch") String batch, @Param("money") Integer money, @Param("mobile") String mobile,
												@Param("parentid") String parentid, @Param("cardno") String cardno, @Param("termofvalidity") Integer termofvalidity,
												@Param("probationperiod") Integer probationperiod, @Param("cardnoFrom") String cardnoFrom, @Param("cardnoTo") String cardnoTo,
												@Param("datastatus") Boolean datastatus, @Param("type") Integer type, @Param("feelroute") String feelroute);

    int batchAddCards(@Param("list") List<Rechargeablecards> list);

    int countByAllNew(@Param("status") Integer status, @Param("batch") String batch, @Param("money") Integer money,
					  @Param("mobile") String mobile, @Param("parentidArr") List<String> parentid, @Param("cardno") String cardno, @Param("termofvalidity") Integer termofvalidity,
					  @Param("probationperiod") Integer probationperiod, @Param("cardnoFrom") String cardnoFrom, @Param("cardnoTo") String cardnoTo,
					  @Param("datastatus") Boolean datastatus, @Param("type") Integer type, @Param("feelroute") String feelroute);

	List<Rechargeablecards> selectByAllNew(@Param("page") Page page, @Param("status") Integer status,
										   @Param("batch") String batch, @Param("money") Integer money, @Param("mobile") String mobile,
										   @Param("parentidArr") List<String> parentid, @Param("cardno") String cardno, @Param("termofvalidity") Integer termofvalidity,
										   @Param("probationperiod") Integer probationperiod, @Param("cardnoFrom") String cardnoFrom, @Param("cardnoTo") String cardnoTo,
										   @Param("datastatus") Boolean datastatus, @Param("type") Integer type, @Param("feelroute") String feelroute);

    List<Rechargeablecards> selectByCPS(@Param("cardno") String cardno,@Param("pwd") String pwd, @Param("status") int status);

    String selectMaxCards(String sBatch);

	String selectMinCards(String sBatch);

    int updateBatchAndCardsBetween(@Param("batch") String batch,@Param("cardnoFrom") String cardnoFrom,@Param("cardnoTo") String cardnoTo, @Param("userid") String userid);
}